import { createApp, h } from 'vue'
import App from './App.vue'
import router from './router'
import singleSpaVue from 'single-spa-vue'

// let instance = null
const render = () => {
  // instance = createApp(App)
  createApp(App).use(router).mount('#app')
}
if (!window.singleSpaNavigate) {  
  render()
}

const vueLifeCycles = singleSpaVue({
  createApp,
  appOptions: {
    router,
    render: () => h (App),
    // render () {
    //   h (App, {
    //     props: {}
    //   })
    // },
    props: {},
  },
  handleInstance (instance) {
    instance.use(router)
  }
})

// 开始加载结构
export const bootstrap = vueLifeCycles.bootstrap;
// 
export const mount = vueLifeCycles.mount;

export const unmount = vueLifeCycles.unmount;